#include<iostream>
#include<algorithm>
using namespace std;

class student
{
public :
	int id;
	double score;
	bool operator<(const student& other)
	{
		return score < other.score;  
	}
};

student a[100005];

int main()
{
	int n; cin >> n; int k; cin >> k;
	for (int i = 0; i < n; i++)
	{
		cin >> a[i].id >> a[i].score;  
	}
	sort(a, a + n, [](student a, student b) {
		return a.score > b.score; 
		});
	//for (int i=0;i<n;i++)
	//	cout << a[i].id << " " << a[i].score << endl;

	cout <<a[k-1].id<<" "<< a[k - 1].score << endl;
	return 0;

}
